function [ output_args ] = wrist()

close all;

[file_name, file_path] = uigetfile('../Trajectory/*.csv', 'Load Wrist Data', 'MultiSelect', 'on');

force_figure = figure('name', 'force');
torque_figure = figure('name', 'torque');
position_figure = figure('name', 'position');
quaternion_figure = figure('name', 'quaternion');

if ~isequal(file_name, 0)
    file_name = cellstr(file_name);  % Care for a single selection
    for i = 1:numel(file_name)
        wrist_data =  csvread(fullfile(file_path, file_name{i}));
        time_step = wrist_data(:,1);
        weight = wrist_data(:,2);
        mu = wrist_data(:,3);
        force = wrist_data(:,4:6);
        torque = wrist_data(:,7:9);
        pos = wrist_data(:,10:12);
        q = wrist_data(:,13:16);
        
        %force graph
        set(0, 'currentfigure', force_figure);
        fx = force(:,1);
        fy = force(:,2);
        fz = force(:,3);
        
        hold on;
        subplot(3,1,1);
        plot(time_step, fx, 'LineWidth', 1);
        xlabel('time');
        ylabel('fx');
        
        hold on;
        subplot(3,1,2);
        plot(time_step, fy, 'LineWidth', 1);
        xlabel('time');
        ylabel('fy');
        
        hold on;
        subplot(3,1,3);
        plot(time_step, fz, 'LineWidth', 1);
        xlabel('time');
        ylabel('fz');
        
        %torque graph
        set(0, 'currentfigure', torque_figure);
        tx = torque(:,1);
        ty = torque(:,2);
        tz = torque(:,3);
        
        hold on;
        subplot(3,1,1);
        plot(time_step, tx, 'LineWidth', 1);
        xlabel('time');
        ylabel('tx');
        
        hold on;
        subplot(3,1,2);
        plot(time_step, ty, 'LineWidth', 1);
        xlabel('time');
        ylabel('ty');
        
        hold on;
        subplot(3,1,3);
        plot(time_step, tz, 'LineWidth', 1);
        xlabel('time');
        ylabel('tz');
        
        %position graph
        set(0, 'currentfigure', position_figure);
        px = pos(:,1);
        py = pos(:,2);
        pz = pos(:,3);
        
        hold on;
        subplot(3,1,1);
        plot(time_step, px, 'LineWidth', 1);
        xlabel('time');
        ylabel('px');
        
        hold on;
        subplot(3,1,2);
        plot(time_step, py, 'LineWidth', 1);
        xlabel('time');
        ylabel('py');
        
        hold on;
        subplot(3,1,3);
        plot(time_step, pz, 'LineWidth', 1);
        xlabel('time');
        ylabel('pz');
        
        %quaternion graph
        set(0, 'currentfigure', quaternion_figure);
        qw = q(:,1);
        qx = q(:,2);
        qy = q(:,3);
        qz = q(:,4);
        
        hold on;
        subplot(4,1,1);
        plot(time_step, qw, 'LineWidth', 1);
        xlabel('time');
        ylabel('qw');
        
        hold on;
        subplot(4,1,2);
        plot(time_step, qx, 'LineWidth', 1);
        xlabel('time');
        ylabel('qx');
        
        hold on;
        subplot(4,1,3);
        plot(time_step, qy, 'LineWidth', 1);
        xlabel('time');
        ylabel('qy');
        
        hold on;
        subplot(4,1,4);
        plot(time_step, qz, 'LineWidth', 1);
        xlabel('time');
        ylabel('qz');
    end
end

end

